home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / Utilities / GrabDrivers / GrabVideoDrivers.c < prev    next >
MacBinary  |  1994-11-30  |  7.1 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Nov 30 11:45:05 1994, modified Wed Nov 30 11:45:05 1994, creator 'MMCC', type ASCII, 6583 bytes "GrabVideoDrivers.c" , at 0x1a37 508 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 47 72 61 62 56 69 | 64 65 6f 44 72 69 76 65 |..GrabVi|deoDrive|
|00000010| 72 73 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |rs.c....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 19 b7 00 | 00 01 fc ab 02 5c 91 ab |........|.....\..|
|00000060| 02 5c 91 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.\......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 11 75 00 00 |........|.....u..|
|00000080| 2f 2a 0d 47 72 61 62 56 | 69 64 65 6f 44 72 69 76 |/*.GrabV|ideoDriv|
|00000090| 65 72 73 2e 63 0d 47 65 | 74 73 20 65 61 63 68 20 |ers.c.Ge|ts each |
|000000a0| 61 63 74 69 76 65 20 76 | 69 64 65 6f 20 64 72 69 |active v|ideo dri|
|000000b0| 76 65 72 20 61 6e 64 20 | 73 61 76 65 73 20 69 74 |ver and |saves it|
|000000c0| 20 69 6e 20 61 20 66 69 | 6c 65 20 6f 66 20 74 68 | in a fi|le of th|
|000000d0| 65 20 73 61 6d 65 20 6e | 61 6d 65 2c 20 75 73 69 |e same n|ame, usi|
|000000e0| 6e 67 20 74 68 65 0d 64 | 72 69 76 65 72 27 73 20 |ng the.d|river's |
|000000f0| 76 65 72 73 69 6f 6e 20 | 6e 75 6d 62 65 72 20 61 |version |number a|
|00000100| 73 20 61 20 72 65 73 6f | 75 72 63 65 20 69 64 2e |s a reso|urce id.|
|00000110| 20 54 68 65 73 65 20 66 | 69 6c 65 73 20 63 61 6e | These f|iles can|
|00000120| 20 6c 61 74 65 72 20 62 | 65 20 65 78 61 6d 69 6e | later b|e examin|
|00000130| 65 64 20 69 6e 0d 52 65 | 73 45 64 69 74 2c 20 75 |ed in.Re|sEdit, u|
|00000140| 73 69 6e 67 20 74 68 65 | 20 70 75 62 6c 69 63 20 |sing the| public |
|00000150| 64 6f 6d 61 69 6e 20 43 | 4f 44 45 20 65 64 69 74 |domain C|ODE edit|
|00000160| 6f 72 2e 20 59 6f 75 27 | 6c 6c 20 77 61 6e 74 20 |or. You'|ll want |
|00000170| 74 6f 20 63 6f 6e 73 75 | 6c 74 20 41 70 70 6c 65 |to consu|lt Apple|
|00000180| 27 73 0d 44 65 73 69 67 | 6e 69 6e 67 20 43 61 72 |'s.Desig|ning Car|
|00000190| 64 73 20 61 6e 64 20 44 | 72 69 76 65 72 73 2c 20 |ds and D|rivers, |
|000001a0| 33 72 64 20 45 64 2e 2c | 20 41 64 64 69 73 6f 6e |3rd Ed.,| Addison|
|000001b0| 20 57 65 73 6c 65 79 2e | 0d 0d 54 68 65 20 52 65 | Wesley.|..The Re|
|000001c0| 73 45 64 69 74 20 43 4f | 44 45 20 65 64 69 74 6f |sEdit CO|DE edito|
|000001d0| 72 20 69 73 20 61 20 70 | 75 62 6c 69 63 20 64 6f |r is a p|ublic do|
|000001e0| 6d 61 69 6e 20 66 69 6c | 65 2c 20 66 6f 72 20 75 |main fil|e, for u|
|000001f0| 73 65 20 77 69 74 68 20 | 52 65 73 45 64 69 74 2c |se with |ResEdit,|
|00000200| 0d 64 69 73 74 72 69 62 | 75 74 65 64 20 62 79 3a |.distrib|uted by:|
|00000210| 0d 49 72 61 20 4c 2e 20 | 52 75 62 65 6e 0d 41 70 |.Ira L. |Ruben.Ap|
|00000220| 70 6c 65 20 43 6f 6d 70 | 75 74 65 72 2c 20 49 6e |ple Comp|uter, In|
|00000230| 63 2e 0d 32 30 35 32 35 | 20 4d 61 72 69 61 6e 69 |c..20525| Mariani|
|00000240| 20 41 76 65 2e 2c 20 4d | 53 3a 20 33 37 2d 41 0d | Ave., M|S: 37-A.|
|00000250| 43 75 70 65 72 74 69 6e | 6f 2c 20 43 61 2e 20 39 |Cupertin|o, Ca. 9|
|00000260| 35 30 31 34 0d 49 72 61 | 40 41 70 70 6c 65 2e 43 |5014.Ira|@Apple.C|
|00000270| 6f 6d 0d 66 74 70 3a 2f | 2f 66 74 70 2e 61 70 70 |om.ftp:/|/ftp.app|
|00000280| 6c 65 2e 63 6f 6d 2f 64 | 74 73 2f 6d 61 63 2f 74 |le.com/d|ts/mac/t|
|00000290| 6f 6f 6c 73 2f 72 65 73 | 65 64 69 74 2f 0d 0d 43 |ools/res|edit/..C|
|000002a0| 6f 70 79 72 69 67 68 74 | 20 72 65 73 74 72 69 63 |opyright| restric|
|000002b0| 74 69 6f 6e 73 20 70 72 | 65 76 65 6e 74 20 75 73 |tions pr|event us|
|000002c0| 20 66 72 6f 6d 20 64 69 | 73 74 72 69 62 75 74 69 | from di|stributi|
|000002d0| 6e 67 20 76 69 64 65 6f | 20 64 72 69 76 65 72 73 |ng video| drivers|
|000002e0| 20 74 68 65 6d 73 65 6c | 76 65 73 2c 0d 62 75 74 | themsel|ves,.but|
|000002f0| 20 74 68 69 73 20 70 72 | 6f 67 72 61 6d 20 6d 61 | this pr|ogram ma|
|00000300| 6b 65 73 20 69 74 20 65 | 61 73 79 20 66 6f 72 20 |kes it e|asy for |
|00000310| 79 6f 75 20 74 6f 20 67 | 65 74 20 61 6e 20 61 63 |you to g|et an ac|
|00000320| 63 65 73 73 69 62 6c 65 | 20 63 6f 70 79 20 6f 66 |cessible| copy of|
|00000330| 20 61 6c 6c 20 74 68 65 | 0d 76 69 64 65 6f 20 64 | all the|.video d|
|00000340| 72 69 76 65 72 73 20 75 | 73 65 64 20 69 6e 20 79 |rivers u|sed in y|
|00000350| 6f 75 72 20 6f 77 6e 20 | 63 6f 6d 70 75 74 65 72 |our own |computer|
|00000360| 73 2e 0d 0d 54 68 65 20 | 70 72 69 6d 61 72 79 20 |s...The |primary |
|00000370| 75 73 65 72 73 20 6f 66 | 20 74 68 69 73 20 70 72 |users of| this pr|
|00000380| 6f 67 72 61 6d 20 77 69 | 6c 6c 20 70 72 6f 62 61 |ogram wi|ll proba|
|00000390| 62 6c 79 20 62 65 20 74 | 68 6f 73 65 20 77 68 6f |bly be t|hose who|
|000003a0| 20 77 69 73 68 20 74 6f | 20 65 6e 68 61 6e 63 65 | wish to| enhance|
|000003b0| 0d 53 65 74 45 6e 74 72 | 69 65 73 51 75 69 63 6b |.SetEntr|iesQuick|
|000003c0| 6c 79 2e 63 2e 20 49 20 | 68 6f 70 65 20 74 68 61 |ly.c. I |hope tha|
|000003d0| 74 20 70 65 6f 70 6c 65 | 20 77 69 6c 6c 20 73 68 |t people| will sh|
|000003e0| 61 72 65 20 74 68 65 20 | 66 72 75 69 74 73 20 6f |are the |fruits o|
|000003f0| 66 20 74 68 65 69 72 20 | 6c 61 62 6f 72 73 20 62 |f their |labors b|
|00000400| 79 0d 73 65 6e 64 69 6e | 67 20 6d 65 20 74 68 65 |y.sendin|g me the|
|00000410| 20 65 6e 68 61 6e 63 65 | 6d 65 6e 74 73 20 66 6f | enhance|ments fo|
|00000420| 72 20 64 69 73 74 72 69 | 62 75 74 69 6f 6e 20 61 |r distri|bution a|
|00000430| 73 20 70 61 72 74 20 6f | 66 20 74 68 65 20 56 69 |s part o|f the Vi|
|00000440| 64 65 6f 54 6f 6f 6c 62 | 6f 78 2e 0d 0d 54 68 69 |deoToolb|ox...Thi|
|00000450| 73 20 70 72 6f 67 72 61 | 6d 20 69 73 20 61 6c 73 |s progra|m is als|
|00000460| 6f 20 75 73 65 66 75 6c | 20 66 6f 72 20 63 6f 70 |o useful| for cop|
|00000470| 79 69 6e 67 20 74 68 65 | 20 4d 61 63 20 49 49 73 |ying the| Mac IIs|
|00000480| 69 20 76 69 64 65 6f 20 | 64 72 69 76 65 72 20 74 |i video |driver t|
|00000490| 6f 20 74 68 65 20 4d 61 | 63 0d 49 49 63 69 2e 20 |o the Ma|c.IIci. |
|000004a0| 53 69 6e 63 65 20 74 68 | 61 74 27 73 20 61 20 52 |Since th|at's a R|
|000004b0| 4f 4d 2d 62 61 73 65 64 | 20 64 72 69 76 65 72 20 |OM-based| driver |
|000004c0| 49 20 64 6f 6e 27 74 20 | 6b 6e 6f 77 20 61 6e 79 |I don't |know any|
|000004d0| 20 77 61 79 20 74 6f 20 | 61 75 74 6f 6d 61 74 69 | way to |automati|
|000004e0| 63 61 6c 6c 79 0d 64 65 | 74 65 72 6d 69 6e 65 20 |cally.de|termine |
|000004f0| 69 74 73 20 73 69 7a 65 | 2c 20 61 6e 64 20 69 6e |its size|, and in|
|00000500| 73 74 65 61 64 20 74 68 | 69 73 20 70 72 6f 67 72 |stead th|is progr|
|00000510| 61 6d 20 75 73 65 73 20 | 61 20 67 65 6e 65 72 6f |am uses |a genero|
|00000520| 75 73 20 67 75 65 73 73 | 2e 20 43 6f 6e 73 65 71 |us guess|. Conseq|
|00000530| 75 65 6e 74 6c 79 0d 74 | 68 65 20 72 65 73 75 6c |uently.t|he resul|
|00000540| 74 69 6e 67 20 72 65 73 | 6f 75 72 63 65 20 69 73 |ting res|ource is|
|00000550| 20 6c 61 72 67 65 72 20 | 74 68 61 6e 20 69 74 20 | larger |than it |
|00000560| 6e 65 65 64 73 20 74 6f | 20 62 65 2e 20 57 68 65 |needs to| be. Whe|
|00000570| 6e 20 79 6f 75 20 69 6e | 73 74 61 6c 6c 20 74 68 |n you in|stall th|
|00000580| 69 73 0d 72 65 73 6f 75 | 72 63 65 20 69 6e 20 74 |is.resou|rce in t|
|00000590| 68 65 20 53 79 73 74 65 | 6d 20 66 69 6c 65 20 6f |he Syste|m file o|
|000005a0| 66 20 79 6f 75 72 20 4d | 61 63 20 49 49 63 69 20 |f your M|ac IIci |
|000005b0| 74 68 65 20 65 78 63 65 | 73 73 20 73 70 61 63 65 |the exce|ss space|
|000005c0| 20 69 73 20 77 61 73 74 | 65 64 20 28 62 6f 74 68 | is wast|ed (both|
|000005d0| 20 6f 6e 0d 64 69 73 6b | 20 61 6e 64 20 69 6e 20 | on.disk| and in |
|000005e0| 6d 65 6d 6f 72 79 29 2c | 20 62 75 74 20 74 68 65 |memory),| but the|
|000005f0| 20 65 78 63 65 73 73 20 | 69 73 20 6f 6e 6c 79 20 | excess |is only |
|00000600| 61 62 6f 75 74 20 31 20 | 6b 42 2c 20 73 6f 20 69 |about 1 |kB, so i|
|00000610| 74 20 64 6f 65 73 6e 27 | 74 20 73 65 65 6d 20 77 |t doesn'|t seem w|
|00000620| 6f 72 74 68 0d 77 6f 72 | 72 79 69 6e 67 20 61 62 |orth.wor|rying ab|
|00000630| 6f 75 74 2e 0d 0d 48 49 | 53 54 4f 52 59 3a 0d 32 |out...HI|STORY:.2|
|00000640| 2f 38 39 20 64 67 70 20 | 57 72 6f 74 65 20 69 74 |/89 dgp |Wrote it|
|00000650| 20 61 73 20 22 76 69 64 | 65 6f 20 68 61 63 6b 65 | as "vid|eo hacke|
|00000660| 72 20 49 49 2e 63 22 20 | 75 73 69 6e 67 20 54 48 |r II.c" |using TH|
|00000670| 49 4e 4b 20 22 4c 69 67 | 68 74 20 53 70 65 65 64 |INK "Lig|ht Speed|
|00000680| 22 20 43 20 33 2e 0d 31 | 32 2f 33 30 2f 39 32 20 |" C 3..1|2/30/92 |
|00000690| 64 67 70 20 75 70 64 61 | 74 65 64 20 69 74 20 74 |dgp upda|ted it t|
|000006a0| 6f 20 54 48 49 4e 4b 20 | 43 20 35 20 61 6e 64 20 |o THINK |C 5 and |
|000006b0| 72 65 6e 61 6d 65 64 20 | 69 74 20 47 72 61 62 56 |renamed |it GrabV|
|000006c0| 69 64 65 6f 44 72 69 76 | 65 72 73 2e 63 0d 37 2f |ideoDriv|ers.c.7/|
|000006d0| 32 39 2f 39 34 20 64 67 | 70 20 45 6c 69 6d 69 6e |29/94 dg|p Elimin|
|000006e0| 61 74 65 64 20 75 73 65 | 20 6f 66 20 22 23 73 22 |ated use| of "#s"|
|000006f0| 20 70 72 69 6e 74 66 20 | 66 6f 72 6d 61 74 2c 20 | printf |format, |
|00000700| 73 69 6e 63 65 20 69 74 | 27 73 20 6e 6f 74 20 73 |since it|'s not s|
|00000710| 75 70 70 6f 72 74 65 64 | 20 62 79 0d 09 09 09 4d |upported| by....M|
|00000720| 65 74 72 6f 77 65 72 6b | 73 20 43 6f 64 65 57 61 |etrowerk|s CodeWa|
|00000730| 72 72 69 6f 72 20 43 2e | 0d 39 2f 35 2f 39 34 20 |rrior C.|.9/5/94 |
|00000740| 64 67 70 20 72 65 6d 6f | 76 65 64 20 61 73 73 75 |dgp remo|ved assu|
|00000750| 6d 70 74 69 6f 6e 20 69 | 6e 20 70 72 69 6e 74 66 |mption i|n printf|
|00000760| 27 73 20 74 68 61 74 20 | 69 6e 74 3d 3d 73 68 6f |'s that |int==sho|
|00000770| 72 74 2e 0d 2a 2f 0d 23 | 69 6e 63 6c 75 64 65 20 |rt..*/.#|include |
|00000780| 22 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 2e 68 22 |"VideoTo|olbox.h"|
|00000790| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 45 72 72 6f 72 |.#includ|e <Error|
|000007a0| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 46 |s.h>.#in|clude <F|
|000007b0| 69 6c 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |iles.h>.|#include|
|000007c0| 20 3c 52 65 73 6f 75 72 | 63 65 73 2e 68 3e 0d 23 | <Resour|ces.h>.#|
|000007d0| 64 65 66 69 6e 65 20 64 | 52 41 4d 42 61 73 65 64 |define d|RAMBased|
|000007e0| 09 09 30 78 30 30 34 30 | 0d 48 61 6e 64 6c 65 20 |..0x0040|.Handle |
|000007f0| 47 65 74 44 72 69 76 65 | 72 46 72 6f 6d 53 6c 6f |GetDrive|rFromSlo|
|00000800| 74 4d 61 6e 61 67 65 72 | 28 47 44 48 61 6e 64 6c |tManager|(GDHandl|
|00000810| 65 20 64 65 76 69 63 65 | 29 3b 0d 0d 76 6f 69 64 |e device|);..void|
|00000820| 20 6d 61 69 6e 28 76 6f | 69 64 29 3b 0d 76 6f 69 | main(vo|id);.voi|
|00000830| 64 20 43 6f 70 79 44 65 | 76 69 63 65 44 72 69 76 |d CopyDe|viceDriv|
|00000840| 65 72 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |er(GDHan|dle devi|
|00000850| 63 65 29 3b 0d 76 6f 69 | 64 20 41 64 64 52 65 73 |ce);.voi|d AddRes|
|00000860| 6f 75 72 63 65 54 6f 46 | 69 6c 65 28 75 6e 73 69 |ourceToF|ile(unsi|
|00000870| 67 6e 65 64 20 63 68 61 | 72 20 2a 66 69 6c 65 6e |gned cha|r *filen|
|00000880| 61 6d 65 2c 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |ame,unsi|gned cha|
|00000890| 72 20 2a 6e 61 6d 65 2c | 52 65 73 54 79 70 65 20 |r *name,|ResType |
|000008a0| 74 79 70 65 0d 09 2c 69 | 6e 74 20 69 64 2c 48 61 |type..,i|nt id,Ha|
|000008b0| 6e 64 6c 65 20 68 61 6e | 64 6c 65 29 3b 0d 74 79 |ndle han|dle);.ty|
|000008c0| 70 65 64 65 66 20 73 74 | 72 75 63 74 20 7b 0d 09 |pedef st|ruct {..|
|000008d0| 73 68 6f 72 74 20 66 6c | 61 67 73 3b 0d 09 73 68 |short fl|ags;..sh|
|000008e0| 6f 72 74 20 62 6c 61 6e | 6b 73 5b 33 5d 3b 0d 09 |ort blan|ks[3];..|
|000008f0| 73 68 6f 72 74 20 6f 70 | 65 6e 3b 0d 09 73 68 6f |short op|en;..sho|
|00000900| 72 74 20 70 72 69 6d 65 | 3b 0d 09 73 68 6f 72 74 |rt prime|;..short|
|00000910| 20 63 6f 6e 74 72 6f 6c | 3b 0d 09 73 68 6f 72 74 | control|;..short|
|00000920| 20 73 74 61 74 75 73 3b | 0d 09 73 68 6f 72 74 20 | status;|..short |
|00000930| 63 6c 6f 73 65 3b 0d 09 | 53 74 72 32 35 35 20 6e |close;..|Str255 n|
|00000940| 61 6d 65 3b 0d 7d 20 56 | 69 64 65 6f 44 72 69 76 |ame;.} V|ideoDriv|
|00000950| 65 72 3b 0d 56 69 64 65 | 6f 44 72 69 76 65 72 20 |er;.Vide|oDriver |
|00000960| 2a 47 44 44 72 69 76 65 | 72 41 64 64 72 65 73 73 |*GDDrive|rAddress|
|00000970| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00000980| 29 3b 0d 0d 76 6f 69 64 | 20 6d 61 69 6e 28 29 0d |);..void| main().|
|00000990| 7b 0d 09 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |{..GDHan|dle devi|
|000009a0| 63 65 3b 0d 09 69 6e 74 | 20 69 3b 0d 09 0d 09 4d |ce;..int| i;....M|
|000009b0| 61 78 69 6d 69 7a 65 43 | 6f 6e 73 6f 6c 65 48 65 |aximizeC|onsoleHe|
|000009c0| 69 67 68 74 28 29 3b 0d | 09 70 72 69 6e 74 66 28 |ight();.|.printf(|
|000009d0| 22 57 65 6c 63 6f 6d 65 | 20 74 6f 20 47 72 61 62 |"Welcome| to Grab|
|000009e0| 56 69 64 65 6f 44 72 69 | 76 65 72 2e 5c 6e 22 29 |VideoDri|ver.\n")|
|000009f0| 3b 0d 09 70 72 69 6e 74 | 66 28 42 72 65 61 6b 4c |;..print|f(BreakL|
|00000a00| 69 6e 65 73 28 22 54 68 | 69 73 20 70 72 6f 67 72 |ines("Th|is progr|
|00000a10| 61 6d 20 63 79 63 6c 65 | 73 20 74 68 72 6f 75 67 |am cycle|s throug|
|00000a20| 68 20 61 6c 6c 20 79 6f | 75 72 20 76 69 64 65 6f |h all yo|ur video|
|00000a30| 20 64 65 76 69 63 65 73 | 20 61 6e 64 20 63 6f 70 | devices| and cop|
|00000a40| 69 65 73 20 22 0d 09 22 | 65 61 63 68 20 64 72 69 |ies ".."|each dri|
|00000a50| 76 65 72 20 69 6e 74 6f | 20 61 20 72 65 73 6f 75 |ver into| a resou|
|00000a60| 72 63 65 20 66 69 6c 65 | 2c 20 73 75 69 74 61 62 |rce file|, suitab|
|00000a70| 6c 65 20 66 6f 72 20 73 | 75 62 73 65 71 75 65 6e |le for s|ubsequen|
|00000a80| 74 20 65 78 61 6d 69 6e | 61 74 69 6f 6e 20 22 0d |t examin|ation ".|
|00000a90| 09 22 77 69 74 68 20 52 | 65 73 45 64 69 74 20 28 |."with R|esEdit (|
|00000aa0| 77 69 74 68 20 74 68 65 | 20 43 4f 44 45 20 65 64 |with the| CODE ed|
|00000ab0| 69 74 6f 72 29 2e 20 54 | 68 69 73 20 69 73 20 70 |itor). T|his is p|
|00000ac0| 72 69 6d 61 72 69 6c 79 | 20 6f 66 20 69 6e 74 65 |rimarily| of inte|
|00000ad0| 72 65 73 74 20 66 6f 72 | 20 70 65 6f 70 6c 65 20 |rest for| people |
|00000ae0| 22 0d 09 22 77 68 6f 20 | 77 61 6e 74 20 74 6f 20 |".."who |want to |
|00000af0| 65 6e 68 61 6e 63 65 20 | 53 65 74 45 6e 74 72 69 |enhance |SetEntri|
|00000b00| 65 73 51 75 69 63 6b 6c | 79 2e 63 20 74 6f 20 73 |esQuickl|y.c to s|
|00000b10| 75 70 70 6f 72 74 20 6d | 6f 72 65 20 76 69 64 65 |upport m|ore vide|
|00000b20| 6f 20 64 65 76 69 63 65 | 73 2e 5c 6e 22 2c 37 38 |o device|s.\n",78|
|00000b30| 29 29 3b 0d 09 66 6f 72 | 28 69 3d 30 3b 69 3c 31 |));..for|(i=0;i<1|
|00000b40| 30 3b 69 2b 2b 29 7b 0d | 09 09 64 65 76 69 63 65 |0;i++){.|..device|
|00000b50| 3d 47 65 74 53 63 72 65 | 65 6e 44 65 76 69 63 65 |=GetScre|enDevice|
|00000b60| 28 69 29 3b 0d 09 09 69 | 66 28 64 65 76 69 63 65 |(i);...i|f(device|
|00000b70| 3d 3d 4e 55 4c 4c 29 62 | 72 65 61 6b 3b 0d 09 09 |==NULL)b|reak;...|
|00000b80| 43 6f 70 79 44 65 76 69 | 63 65 44 72 69 76 65 72 |CopyDevi|ceDriver|
|00000b90| 28 64 65 76 69 63 65 29 | 3b 0d 09 7d 0d 09 70 72 |(device)|;..}..pr|
|00000ba0| 69 6e 74 66 28 22 5c 6e | 44 6f 6e 65 2e 5c 6e 22 |intf("\n|Done.\n"|
|00000bb0| 29 3b 0d 7d 0d 0d 76 6f | 69 64 20 43 6f 70 79 44 |);.}..vo|id CopyD|
|00000bc0| 65 76 69 63 65 44 72 69 | 76 65 72 28 47 44 48 61 |eviceDri|ver(GDHa|
|00000bd0| 6e 64 6c 65 20 64 65 76 | 69 63 65 29 0d 7b 0d 09 |ndle dev|ice).{..|
|00000be0| 63 68 61 72 20 2a 6e 61 | 6d 65 2c 66 69 6c 65 6e |char *na|me,filen|
|00000bf0| 61 6d 65 5b 33 32 5d 3b | 0d 09 6c 6f 6e 67 20 64 |ame[32];|..long d|
|00000c00| 72 69 76 65 72 53 69 7a | 65 3b 0d 09 41 75 78 44 |riverSiz|e;..AuxD|
|00000c10| 43 45 20 2a 2a 61 75 78 | 44 43 45 48 61 6e 64 6c |CE **aux|DCEHandl|
|00000c20| 65 3b 0d 09 48 61 6e 64 | 6c 65 20 68 61 6e 64 6c |e;..Hand|le handl|
|00000c30| 65 3b 0d 09 56 69 64 65 | 6f 44 72 69 76 65 72 20 |e;..Vide|oDriver |
|00000c40| 2a 64 72 69 76 65 72 3b | 0d 09 75 6e 73 69 67 6e |*driver;|..unsign|
|00000c50| 65 64 20 63 68 61 72 20 | 2a 62 79 74 65 50 74 72 |ed char |*bytePtr|
|00000c60| 3b 0d 09 69 6e 74 20 76 | 65 72 73 69 6f 6e 3b 0d |;..int v|ersion;.|
|00000c70| 09 0d 09 69 66 28 64 65 | 76 69 63 65 3d 3d 4e 55 |...if(de|vice==NU|
|00000c80| 4c 4c 29 72 65 74 75 72 | 6e 3b 0d 09 70 72 69 6e |LL)retur|n;..prin|
|00000c90| 74 66 28 22 5c 6e 22 29 | 3b 0d 09 6e 61 6d 65 3d |tf("\n")|;..name=|
|00000ca0| 47 44 4e 61 6d 65 53 74 | 72 28 64 65 76 69 63 65 |GDNameSt|r(device|
|00000cb0| 29 3b 0d 09 76 65 72 73 | 69 6f 6e 3d 47 44 56 65 |);..vers|ion=GDVe|
|00000cc0| 72 73 69 6f 6e 28 64 65 | 76 69 63 65 29 3b 0d 09 |rsion(de|vice);..|
|00000cd0| 70 72 69 6e 74 66 28 22 | 25 73 20 76 65 72 73 69 |printf("|%s versi|
|00000ce0| 6f 6e 20 25 64 2e 5c 6e | 22 2c 6e 61 6d 65 2c 76 |on %d.\n|",name,v|
|00000cf0| 65 72 73 69 6f 6e 29 3b | 0d 09 73 74 72 6e 63 70 |ersion);|..strncp|
|00000d00| 79 28 66 69 6c 65 6e 61 | 6d 65 2c 6e 61 6d 65 2c |y(filena|me,name,|
|00000d10| 33 31 29 3b 0d 09 2f 2f | 20 66 69 6c 65 6e 61 6d |31);..//| filenam|
|00000d20| 65 20 6d 75 73 74 20 62 | 65 20 74 72 75 6e 63 61 |e must b|e trunca|
|00000d30| 74 65 64 20 74 6f 20 33 | 31 20 63 68 61 72 61 63 |ted to 3|1 charac|
|00000d40| 74 65 72 73 20 2a 2f 0d | 09 66 69 6c 65 6e 61 6d |ters */.|.filenam|
|00000d50| 65 5b 33 32 5d 3d 30 3b | 0d 09 2f 2f 20 52 65 70 |e[32]=0;|..// Rep|
|00000d60| 6c 61 63 65 20 6c 65 61 | 64 69 6e 67 20 22 2e 22 |lace lea|ding "."|
|00000d70| 20 62 79 20 22 2d 22 20 | 73 69 6e 63 65 20 74 68 | by "-" |since th|
|00000d80| 65 20 4d 61 63 20 66 69 | 6c 69 6e 67 20 73 79 73 |e Mac fi|ling sys|
|00000d90| 74 65 6d 20 0d 09 2f 2f | 20 69 73 20 63 6f 6e 66 |tem ..//| is conf|
|00000da0| 75 73 65 64 20 62 79 20 | 66 69 6c 65 6e 61 6d 65 |used by |filename|
|00000db0| 73 20 62 65 67 69 6e 6e | 69 6e 67 20 77 69 74 68 |s beginn|ing with|
|00000dc0| 20 22 2e 22 2e 0d 09 69 | 66 28 66 69 6c 65 6e 61 | "."...i|f(filena|
|00000dd0| 6d 65 5b 30 5d 3d 3d 27 | 2e 27 29 66 69 6c 65 6e |me[0]=='|.')filen|
|00000de0| 61 6d 65 5b 30 5d 3d 27 | 2d 27 3b 0d 0d 09 64 72 |ame[0]='|-';...dr|
|00000df0| 69 76 65 72 3d 47 44 44 | 72 69 76 65 72 41 64 64 |iver=GDD|riverAdd|
|00000e00| 72 65 73 73 28 64 65 76 | 69 63 65 29 3b 0d 09 70 |ress(dev|ice);..p|
|00000e10| 72 69 6e 74 66 28 22 4f | 66 66 73 65 74 73 3a 20 |rintf("O|ffsets: |
|00000e20| 6f 70 65 6e 20 30 78 25 | 78 2c 20 70 72 69 6d 65 |open 0x%|x, prime|
|00000e30| 20 30 78 25 78 2c 20 63 | 6f 6e 74 72 6f 6c 20 30 | 0x%x, c|ontrol 0|
|00000e40| 78 25 78 2c 20 73 74 61 | 74 75 73 20 30 78 25 78 |x%x, sta|tus 0x%x|
|00000e50| 2c 20 63 6c 6f 73 65 20 | 30 78 25 78 5c 6e 22 0d |, close |0x%x\n".|
|00000e60| 09 09 2c 64 72 69 76 65 | 72 2d 3e 6f 70 65 6e 2c |..,drive|r->open,|
|00000e70| 64 72 69 76 65 72 2d 3e | 70 72 69 6d 65 2c 64 72 |driver->|prime,dr|
|00000e80| 69 76 65 72 2d 3e 63 6f | 6e 74 72 6f 6c 2c 64 72 |iver->co|ntrol,dr|
|00000e90| 69 76 65 72 2d 3e 73 74 | 61 74 75 73 2c 64 72 69 |iver->st|atus,dri|
|00000ea0| 76 65 72 2d 3e 63 6c 6f | 73 65 29 3b 0d 09 70 72 |ver->clo|se);..pr|
|00000eb0| 69 6e 74 66 28 22 6e 61 | 6d 65 20 69 73 20 61 74 |intf("na|me is at|
|00000ec0| 20 30 78 25 6c 78 2c 20 | 22 2c 64 72 69 76 65 72 | 0x%lx, |",driver|
|00000ed0| 2d 3e 6e 61 6d 65 2d 28 | 75 6e 73 69 67 6e 65 64 |->name-(|unsigned|
|00000ee0| 20 63 68 61 72 20 2a 29 | 20 64 72 69 76 65 72 29 | char *)| driver)|
|00000ef0| 3b 0d 09 62 79 74 65 50 | 74 72 3d 64 72 69 76 65 |;..byteP|tr=drive|
|00000f00| 72 2d 3e 6e 61 6d 65 3b | 0d 09 62 79 74 65 50 74 |r->name;|..bytePt|
|00000f10| 72 20 2b 3d 20 31 2b 62 | 79 74 65 50 74 72 5b 30 |r += 1+b|ytePtr[0|
|00000f20| 5d 3b 09 2f 2a 20 67 6f | 20 74 6f 20 65 6e 64 20 |];./* go| to end |
|00000f30| 6f 66 20 50 61 73 63 61 | 6c 20 73 74 72 69 6e 67 |of Pasca|l string|
|00000f40| 20 2a 2f 0d 09 62 79 74 | 65 50 74 72 20 3d 20 28 | */..byt|ePtr = (|
|00000f50| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 29 |unsigned| char *)|
|00000f60| 28 28 6c 6f 6e 67 29 28 | 62 79 74 65 50 74 72 2b |((long)(|bytePtr+|
|00000f70| 31 29 20 26 20 7e 31 29 | 3b 09 2f 2f 20 72 6f 75 |1) & ~1)|;.// rou|
|00000f80| 6e 64 20 75 70 20 74 6f | 20 77 6f 72 64 20 62 6f |nd up to| word bo|
|00000f90| 75 6e 64 61 72 79 0d 09 | 70 72 69 6e 74 66 28 22 |undary..|printf("|
|00000fa0| 76 65 72 73 69 6f 6e 20 | 69 73 20 61 74 20 30 78 |version |is at 0x|
|00000fb0| 25 6c 78 5c 6e 22 2c 62 | 79 74 65 50 74 72 2d 28 |%lx\n",b|ytePtr-(|
|00000fc0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 29 |unsigned| char *)|
|00000fd0| 20 64 72 69 76 65 72 29 | 3b 0d 0d 09 61 75 78 44 | driver)|;...auxD|
|00000fe0| 43 45 48 61 6e 64 6c 65 | 20 3d 20 28 41 75 78 44 |CEHandle| = (AuxD|
|00000ff0| 43 45 20 2a 2a 29 20 47 | 65 74 44 43 74 6c 45 6e |CE **) G|etDCtlEn|
|00001000| 74 72 79 28 28 2a 64 65 | 76 69 63 65 29 2d 3e 67 |try((*de|vice)->g|
|00001010| 64 52 65 66 4e 75 6d 29 | 3b 0d 09 69 66 28 28 2a |dRefNum)|;..if((*|
|00001020| 2a 61 75 78 44 43 45 48 | 61 6e 64 6c 65 29 2e 64 |*auxDCEH|andle).d|
|00001030| 43 74 6c 46 6c 61 67 73 | 20 26 20 64 52 41 4d 42 |CtlFlags| & dRAMB|
|00001040| 61 73 65 64 29 7b 0d 09 | 09 70 72 69 6e 74 66 28 |ased){..|.printf(|
|00001050| 22 52 41 4d 2d 62 61 73 | 65 64 20 64 72 69 76 65 |"RAM-bas|ed drive|
|00001060| 72 2e 5c 6e 22 29 3b 0d | 09 09 68 61 6e 64 6c 65 |r.\n");.|..handle|
|00001070| 3d 28 48 61 6e 64 6c 65 | 29 28 2a 2a 61 75 78 44 |=(Handle|)(**auxD|
|00001080| 43 45 48 61 6e 64 6c 65 | 29 2e 64 43 74 6c 44 72 |CEHandle|).dCtlDr|
|00001090| 69 76 65 72 3b 0d 09 09 | 48 61 6e 64 54 6f 48 61 |iver;...|HandToHa|
|000010a0| 6e 64 28 26 68 61 6e 64 | 6c 65 29 3b 0d 09 09 70 |nd(&hand|le);...p|
|000010b0| 72 69 6e 74 66 28 22 25 | 6c 64 20 62 79 74 65 73 |rintf("%|ld bytes|
|000010c0| 5c 6e 22 2c 47 65 74 48 | 61 6e 64 6c 65 53 69 7a |\n",GetH|andleSiz|
|000010d0| 65 28 68 61 6e 64 6c 65 | 29 29 3b 0d 09 7d 0d 09 |e(handle|));..}..|
|000010e0| 65 6c 73 65 7b 0d 09 09 | 70 72 69 6e 74 66 28 22 |else{...|printf("|
|000010f0| 52 4f 4d 2d 62 61 73 65 | 64 20 64 72 69 76 65 72 |ROM-base|d driver|
|00001100| 2e 5c 6e 22 29 3b 0d 09 | 09 68 61 6e 64 6c 65 3d |.\n");..|.handle=|
|00001110| 47 65 74 44 72 69 76 65 | 72 46 72 6f 6d 53 6c 6f |GetDrive|rFromSlo|
|00001120| 74 4d 61 6e 61 67 65 72 | 28 64 65 76 69 63 65 29 |tManager|(device)|
|00001130| 3b 0d 09 09 69 66 28 68 | 61 6e 64 6c 65 21 3d 4e |;...if(h|andle!=N|
|00001140| 55 4c 4c 29 7b 0d 09 09 | 09 70 72 69 6e 74 66 28 |ULL){...|.printf(|
|00001150| 22 47 6f 74 20 64 72 69 | 76 65 72 20 77 69 74 68 |"Got dri|ver with|
|00001160| 20 68 65 6c 70 20 66 72 | 6f 6d 20 53 6c 6f 74 20 | help fr|om Slot |
|00001170| 4d 61 6e 61 67 65 72 2e | 5c 6e 22 29 3b 0d 09 09 |Manager.|\n");...|
|00001180| 09 70 72 69 6e 74 66 28 | 22 25 6c 64 20 62 79 74 |.printf(|"%ld byt|
|00001190| 65 73 5c 6e 22 2c 47 65 | 74 48 61 6e 64 6c 65 53 |es\n",Ge|tHandleS|
|000011a0| 69 7a 65 28 68 61 6e 64 | 6c 65 29 29 3b 0d 09 09 |ize(hand|le));...|
|000011b0| 7d 65 6c 73 65 7b 0d 09 | 09 09 2f 2f 20 57 65 20 |}else{..|..// We |
|000011c0| 68 61 76 65 20 61 20 50 | 74 72 20 74 6f 20 74 68 |have a P|tr to th|
|000011d0| 65 20 64 72 69 76 65 72 | 2c 20 62 75 74 20 77 65 |e driver|, but we|
|000011e0| 20 64 6f 6e 27 74 20 6b | 6e 6f 77 20 68 6f 77 20 | don't k|now how |
|000011f0| 62 69 67 20 69 74 20 69 | 73 2e 0d 09 09 09 64 72 |big it i|s.....dr|
|00001200| 69 76 65 72 53 69 7a 65 | 3d 28 75 6e 73 69 67 6e |iverSize|=(unsign|
|00001210| 65 64 20 6c 6f 6e 67 29 | 20 47 65 74 50 74 72 53 |ed long)| GetPtrS|
|00001220| 69 7a 65 28 28 50 74 72 | 29 28 2a 2a 61 75 78 44 |ize((Ptr|)(**auxD|
|00001230| 43 45 48 61 6e 64 6c 65 | 29 2e 64 43 74 6c 44 72 |CEHandle|).dCtlDr|
|00001240| 69 76 65 72 29 3b 0d 09 | 09 09 69 66 28 64 72 69 |iver);..|..if(dri|
|00001250| 76 65 72 53 69 7a 65 3d | 3d 30 20 7c 7c 20 4d 65 |verSize=|=0 || Me|
|00001260| 6d 45 72 72 6f 72 28 29 | 29 7b 0d 09 09 09 09 64 |mError()|){.....d|
|00001270| 72 69 76 65 72 53 69 7a | 65 3d 64 72 69 76 65 72 |riverSiz|e=driver|
|00001280| 2d 3e 6f 70 65 6e 3b 0d | 09 09 09 09 69 66 28 64 |->open;.|....if(d|
|00001290| 72 69 76 65 72 53 69 7a | 65 3c 64 72 69 76 65 72 |riverSiz|e<driver|
|000012a0| 2d 3e 70 72 69 6d 65 29 | 64 72 69 76 65 72 53 69 |->prime)|driverSi|
|000012b0| 7a 65 3d 64 72 69 76 65 | 72 2d 3e 70 72 69 6d 65 |ze=drive|r->prime|
|000012c0| 3b 0d 09 09 09 09 69 66 | 28 64 72 69 76 65 72 53 |;.....if|(driverS|
|000012d0| 69 7a 65 3c 64 72 69 76 | 65 72 2d 3e 63 6f 6e 74 |ize<driv|er->cont|
|000012e0| 72 6f 6c 29 64 72 69 76 | 65 72 53 69 7a 65 3d 64 |rol)driv|erSize=d|
|000012f0| 72 69 76 65 72 2d 3e 63 | 6f 6e 74 72 6f 6c 3b 0d |river->c|ontrol;.|
|00001300| 09 09 09 09 69 66 28 64 | 72 69 76 65 72 53 69 7a |....if(d|riverSiz|
|00001310| 65 3c 64 72 69 76 65 72 | 2d 3e 73 74 61 74 75 73 |e<driver|->status|
|00001320| 29 64 72 69 76 65 72 53 | 69 7a 65 3d 64 72 69 76 |)driverS|ize=driv|
|00001330| 65 72 2d 3e 73 74 61 74 | 75 73 3b 0d 09 09 09 09 |er->stat|us;.....|
|00001340| 69 66 28 64 72 69 76 65 | 72 53 69 7a 65 3c 64 72 |if(drive|rSize<dr|
|00001350| 69 76 65 72 2d 3e 63 6c | 6f 73 65 29 64 72 69 76 |iver->cl|ose)driv|
|00001360| 65 72 53 69 7a 65 3d 64 | 72 69 76 65 72 2d 3e 63 |erSize=d|river->c|
|00001370| 6c 6f 73 65 3b 0d 09 09 | 09 09 64 72 69 76 65 72 |lose;...|..driver|
|00001380| 53 69 7a 65 2a 3d 32 3b | 0d 09 09 09 09 70 72 69 |Size*=2;|.....pri|
|00001390| 6e 74 66 28 22 53 69 7a | 65 20 75 6e 6b 6e 6f 77 |ntf("Siz|e unknow|
|000013a0| 6e 2c 20 67 75 65 73 73 | 69 6e 67 20 28 67 65 6e |n, guess|ing (gen|
|000013b0| 65 72 6f 75 73 6c 79 29 | 20 61 74 20 25 6c 64 2c |erously)| at %ld,|
|000013c0| 20 74 77 69 63 65 20 74 | 68 65 20 68 69 67 68 65 | twice t|he highe|
|000013d0| 73 74 20 6f 66 66 73 65 | 74 2e 5c 6e 22 2c 64 72 |st offse|t.\n",dr|
|000013e0| 69 76 65 72 53 69 7a 65 | 29 3b 0d 09 09 09 7d 65 |iverSize|);....}e|
|000013f0| 6c 73 65 20 70 72 69 6e | 74 66 28 22 25 6c 64 20 |lse prin|tf("%ld |
|00001400| 62 79 74 65 73 5c 6e 22 | 2c 64 72 69 76 65 72 53 |bytes\n"|,driverS|
|00001410| 69 7a 65 29 3b 0d 09 09 | 09 50 74 72 54 6f 48 61 |ize);...|.PtrToHa|
|00001420| 6e 64 28 28 2a 2a 61 75 | 78 44 43 45 48 61 6e 64 |nd((**au|xDCEHand|
|00001430| 6c 65 29 2e 64 43 74 6c | 44 72 69 76 65 72 2c 26 |le).dCtl|Driver,&|
|00001440| 68 61 6e 64 6c 65 2c 64 | 72 69 76 65 72 53 69 7a |handle,d|riverSiz|
|00001450| 65 29 3b 0d 09 09 7d 0d | 09 7d 0d 09 69 66 28 68 |e);...}.|.}..if(h|
|00001460| 61 6e 64 6c 65 21 3d 4e | 55 4c 4c 29 7b 0d 09 09 |andle!=N|ULL){...|
|00001470| 41 64 64 52 65 73 6f 75 | 72 63 65 54 6f 46 69 6c |AddResou|rceToFil|
|00001480| 65 28 63 32 70 73 74 72 | 28 66 69 6c 65 6e 61 6d |e(c2pstr|(filenam|
|00001490| 65 29 2c 63 32 70 73 74 | 72 28 6e 61 6d 65 29 2c |e),c2pst|r(name),|
|000014a0| 27 44 52 56 52 27 2c 76 | 65 72 73 69 6f 6e 2c 68 |'DRVR',v|ersion,h|
|000014b0| 61 6e 64 6c 65 29 3b 0d | 09 09 70 72 69 6e 74 66 |andle);.|..printf|
|000014c0| 28 22 44 72 69 76 65 72 | 20 63 6f 70 69 65 64 20 |("Driver| copied |
|000014d0| 74 6f 20 d2 25 73 d3 20 | 66 69 6c 65 2c 20 75 73 |to .%s. |file, us|
|000014e0| 69 6e 67 20 74 68 65 20 | 76 65 72 73 69 6f 6e 20 |ing the |version |
|000014f0| 6e 75 6d 62 65 72 20 25 | 64 20 61 73 20 74 68 65 |number %|d as the|
|00001500| 20 72 65 73 6f 75 72 63 | 65 20 69 64 2e 5c 6e 22 | resourc|e id.\n"|
|00001510| 0d 09 09 09 2c 70 32 63 | 73 74 72 28 28 75 6e 73 |....,p2c|str((uns|
|00001520| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 29 66 69 6c |igned ch|ar *)fil|
|00001530| 65 6e 61 6d 65 29 2c 76 | 65 72 73 69 6f 6e 29 3b |ename),v|ersion);|
|00001540| 0d 09 09 44 69 73 70 6f | 73 48 61 6e 64 6c 65 28 |...Dispo|sHandle(|
|00001550| 68 61 6e 64 6c 65 29 3b | 0d 09 7d 65 6c 73 65 20 |handle);|..}else |
|00001560| 70 72 69 6e 74 66 28 22 | 43 6f 75 6c 64 6e 27 74 |printf("|Couldn't|
|00001570| 20 63 6f 70 79 20 64 72 | 69 76 65 72 2e 5c 6e 22 | copy dr|iver.\n"|
|00001580| 29 3b 0d 7d 0d 0d 2f 2a | 0d 54 68 69 73 20 67 65 |);.}../*|.This ge|
|00001590| 74 73 20 61 20 63 6f 70 | 79 20 6f 66 20 74 68 65 |ts a cop|y of the|
|000015a0| 20 64 72 69 76 65 72 20 | 66 72 6f 6d 20 74 68 65 | driver |from the|
|000015b0| 20 73 6c 6f 74 20 6d 61 | 6e 61 67 65 72 2e 20 52 | slot ma|nager. R|
|000015c0| 65 74 75 72 6e 73 20 4e | 55 4c 4c 20 75 6e 6c 65 |eturns N|ULL unle|
|000015d0| 73 73 20 77 65 20 63 61 | 6e 0d 66 69 6e 64 20 65 |ss we ca|n.find e|
|000015e0| 78 61 63 74 6c 79 20 74 | 68 65 20 73 61 6d 65 20 |xactly t|he same |
|000015f0| 64 72 69 76 65 72 20 61 | 73 20 69 73 20 73 70 65 |driver a|s is spe|
|00001600| 63 69 66 69 65 64 20 62 | 79 20 74 68 65 20 73 75 |cified b|y the su|
|00001610| 70 70 6c 69 65 64 20 47 | 44 48 61 6e 64 6c 65 2e |pplied G|DHandle.|
|00001620| 20 57 65 20 63 68 65 63 | 6b 0d 65 76 65 72 79 20 | We chec|k.every |
|00001630| 62 79 74 65 2e 20 54 68 | 69 73 20 69 73 20 6e 6f |byte. Th|is is no|
|00001640| 74 20 61 20 75 73 65 6c | 65 73 73 20 6f 70 65 72 |t a usel|ess oper|
|00001650| 61 74 69 6f 6e 2c 20 62 | 65 63 61 75 73 65 20 61 |ation, b|ecause a|
|00001660| 6c 74 68 6f 75 67 68 20 | 77 65 20 61 6c 72 65 61 |lthough |we alrea|
|00001670| 64 79 20 68 61 76 65 0d | 74 68 65 20 61 64 64 72 |dy have.|the addr|
|00001680| 65 73 73 20 6f 66 20 74 | 68 65 20 64 72 69 76 65 |ess of t|he drive|
|00001690| 72 2c 20 77 65 20 64 6f | 6e 27 74 20 6e 65 63 65 |r, we do|n't nece|
|000016a0| 73 73 61 72 69 6c 79 20 | 61 6c 72 65 61 64 79 20 |ssarily |already |
|000016b0| 68 61 76 65 20 69 74 73 | 20 73 69 7a 65 2c 20 61 |have its| size, a|
|000016c0| 6e 64 20 74 68 65 0d 73 | 6c 6f 74 20 6d 61 6e 61 |nd the.s|lot mana|
|000016d0| 67 65 72 20 77 69 6c 6c | 20 73 75 70 70 6c 79 20 |ger will| supply |
|000016e0| 75 73 20 77 69 74 68 20 | 61 20 68 61 6e 64 6c 65 |us with |a handle|
|000016f0| 2c 20 66 72 6f 6d 20 77 | 68 69 63 68 20 77 65 20 |, from w|hich we |
|00001700| 63 61 6e 20 6f 62 74 61 | 69 6e 20 74 68 65 20 73 |can obta|in the s|
|00001710| 69 7a 65 2e 0d 2a 2f 0d | 48 61 6e 64 6c 65 20 47 |ize..*/.|Handle G|
|00001720| 65 74 44 72 69 76 65 72 | 46 72 6f 6d 53 6c 6f 74 |etDriver|FromSlot|
|00001730| 4d 61 6e 61 67 65 72 28 | 47 44 48 61 6e 64 6c 65 |Manager(|GDHandle|
|00001740| 20 64 65 76 69 63 65 29 | 0d 7b 0d 09 53 70 42 6c | device)|.{..SpBl|
|00001750| 6f 63 6b 20 73 70 42 6c | 6f 63 6b 3b 0d 09 53 45 |ock spBl|ock;..SE|
|00001760| 42 6c 6f 63 6b 20 73 45 | 42 6c 6f 63 6b 3b 0d 09 |Block sE|Block;..|
|00001770| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 64 |unsigned| char *d|
|00001780| 65 73 69 72 65 64 4e 61 | 6d 65 2c 6e 61 6d 65 5b |esiredNa|me,name[|
|00001790| 32 35 36 5d 3b 0d 09 69 | 6e 74 20 65 72 72 6f 72 |256];..i|nt error|
|000017a0| 3b 0d 09 50 74 72 20 2a | 68 61 6e 64 6c 65 3b 0d |;..Ptr *|handle;.|
|000017b0| 09 0d 09 64 65 73 69 72 | 65 64 4e 61 6d 65 3d 47 |...desir|edName=G|
|000017c0| 44 4e 61 6d 65 28 64 65 | 76 69 63 65 29 3b 0d 09 |DName(de|vice);..|
|000017d0| 73 70 42 6c 6f 63 6b 2e | 73 70 73 45 78 65 63 50 |spBlock.|spsExecP|
|000017e0| 42 6c 6b 20 3d 20 28 50 | 74 72 29 20 26 73 45 42 |Blk = (P|tr) &sEB|
|000017f0| 6c 6f 63 6b 3b 0d 09 73 | 70 42 6c 6f 63 6b 2e 73 |lock;..s|pBlock.s|
|00001800| 70 53 6c 6f 74 20 3d 20 | 30 3b 0d 09 73 70 42 6c |pSlot = |0;..spBl|
|00001810| 6f 63 6b 2e 73 70 49 44 | 20 3d 20 30 3b 0d 09 73 |ock.spID| = 0;..s|
|00001820| 70 42 6c 6f 63 6b 2e 73 | 70 45 78 74 44 65 76 20 |pBlock.s|pExtDev |
|00001830| 3d 20 30 3b 0d 09 77 68 | 69 6c 65 28 31 29 7b 0d |= 0;..wh|ile(1){.|
|00001840| 09 09 65 72 72 6f 72 20 | 3d 20 53 4e 65 78 74 53 |..error |= SNextS|
|00001850| 52 73 72 63 28 26 73 70 | 42 6c 6f 63 6b 29 3b 0d |Rsrc(&sp|Block);.|
|00001860| 09 09 69 66 28 65 72 72 | 6f 72 3d 3d 73 6d 4e 6f |..if(err|or==smNo|
|00001870| 4d 6f 72 65 73 52 73 72 | 63 73 29 20 62 72 65 61 |MoresRsr|cs) brea|
|00001880| 6b 3b 0d 09 09 69 66 28 | 65 72 72 6f 72 29 7b 0d |k;...if(|error){.|
|00001890| 09 09 09 70 72 69 6e 74 | 66 28 22 53 4e 65 78 74 |...print|f("SNext|
|000018a0| 53 52 73 72 63 20 65 72 | 72 6f 72 20 25 64 5c 6e |SRsrc er|ror %d\n|
|000018b0| 22 2c 65 72 72 6f 72 29 | 3b 0d 09 09 09 62 72 65 |",error)|;....bre|
|000018c0| 61 6b 3b 0d 09 09 7d 0d | 09 09 73 70 42 6c 6f 63 |ak;...}.|..spBloc|
|000018d0| 6b 2e 73 70 52 65 73 75 | 6c 74 20 3d 20 28 75 6e |k.spResu|lt = (un|
|000018e0| 73 69 67 6e 65 64 20 6c | 6f 6e 67 29 20 26 6e 61 |signed l|ong) &na|
|000018f0| 6d 65 3b 0d 09 09 65 72 | 72 6f 72 20 3d 20 53 52 |me;...er|ror = SR|
|00001900| 65 61 64 44 72 76 72 4e | 61 6d 65 28 26 73 70 42 |eadDrvrN|ame(&spB|
|00001910| 6c 6f 63 6b 29 3b 0d 09 | 09 69 66 28 21 45 71 75 |lock);..|.if(!Equ|
|00001920| 61 6c 53 74 72 69 6e 67 | 28 64 65 73 69 72 65 64 |alString|(desired|
|00001930| 4e 61 6d 65 2c 6e 61 6d | 65 2c 31 2c 31 29 29 63 |Name,nam|e,1,1))c|
|00001940| 6f 6e 74 69 6e 75 65 3b | 0d 09 09 65 72 72 6f 72 |ontinue;|...error|
|00001950| 20 3d 20 53 47 65 74 44 | 72 69 76 65 72 28 26 73 | = SGetD|river(&s|
|00001960| 70 42 6c 6f 63 6b 29 3b | 0d 09 09 69 66 28 21 65 |pBlock);|...if(!e|
|00001970| 72 72 6f 72 29 63 6f 6e | 74 69 6e 75 65 3b 0d 09 |rror)con|tinue;..|
|00001980| 09 68 61 6e 64 6c 65 20 | 3d 20 28 48 61 6e 64 6c |.handle |= (Handl|
|00001990| 65 29 20 73 70 42 6c 6f | 63 6b 2e 73 70 52 65 73 |e) spBlo|ck.spRes|
|000019a0| 75 6c 74 3b 0d 09 09 69 | 66 28 6d 65 6d 63 6d 70 |ult;...i|f(memcmp|
|000019b0| 28 2a 68 61 6e 64 6c 65 | 2c 47 44 44 72 69 76 65 |(*handle|,GDDrive|
|000019c0| 72 41 64 64 72 65 73 73 | 28 64 65 76 69 63 65 29 |rAddress|(device)|
|000019d0| 2c 47 65 74 48 61 6e 64 | 6c 65 53 69 7a 65 28 68 |,GetHand|leSize(h|
|000019e0| 61 6e 64 6c 65 29 29 21 | 3d 30 29 7b 0d 09 09 09 |andle))!|=0){....|
|000019f0| 44 69 73 70 6f 73 48 61 | 6e 64 6c 65 28 68 61 6e |DisposHa|ndle(han|
|00001a00| 64 6c 65 29 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |dle);...|.break;.|
|00001a10| 09 09 7d 0d 09 09 72 65 | 74 75 72 6e 20 68 61 6e |..}...re|turn han|
|00001a20| 64 6c 65 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |dle;..}.|.return |
|00001a30| 4e 55 4c 4c 3b 0d 7d 00 | 00 00 00 00 00 00 00 00 |NULL;.}.|........|
|00001a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a80| 00 00 01 00 00 00 01 aa | 00 00 00 aa 00 00 00 52 |........|.......R|
|00001a90| 48 c0 18 00 70 00 2f 00 | 4a 04 67 04 72 67 60 0c |H...p./.|J.g.rg`.|
|00001aa0| 2f 0c 4e ba ff 5e 48 c0 | 22 00 58 8f 2f 01 2f 0c |/.N..^H.|".X././.|
|00001ab0| 12 47 72 61 62 56 69 64 | 65 6f 44 72 69 76 65 72 |.GrabVid|eoDriver|
|00001ac0| 73 2e 63 56 02 00 00 00 | 50 61 72 74 53 49 54 21 |s.cV....|PartSIT!|
|00001ad0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 ab bf ee 49 00 00 | 00 00 00 00 01 fc 2f 0c |.....I..|....../.|
|00001b00| 20 54 20 50 22 68 00 bc | 4e 91 2d 6e ff f4 ff ec | T P"h..|N.-n....|
|00001b10| 4e ad 00 7a 59 8f 20 54 | 2f 28 00 10 2f 2b 00 0a |N..zY. T|/(../+..|
|00001b20| 48 6e ff e8 a9 2b 28 1f | 4f ef 00 18 67 00 00 d6 |Hn...+(.|O...g...|
|00001b30| 2f 04 20 17 2d 40 ff e4 | 30 2e ff e6 b0 6e ff ee |/. .-@..|0....n..|
|00001b40| 58 8f 6f 06 3d 6e ff ee | ff e6 30 2e ff e4 b0 6e |X.o.=n..|..0....n|
|00001b50| ff ec 6f 06 3d 6e ff ec | ff e4 70 00 2f 00 2f 2e |..o.=n..|..p././.|
|00001b60| ff e4 20 17 58 8f 2f 00 | 2f 0c 2f 3c 67 72 6f 77 |.. .X./.|/./<grow|
|00001b70| 4e ad 00 fa 4f ef 00 10 | 60 00 00 8a 4a 05 66 72 |N...O...|`...J.fr|
|00001b80| 00 00 00 0a 00 00 13 a1 | 00 8e 00 00 00 00 00 00 |........|........|
|00001b90| 00 4c 00 03 00 00 08 da | 00 00 08 de 05 6d 61 69 |.L......|.....mai|
|00001ba0| 6e 00 00 00 0b 00 00 00 | 0b 10 11 43 6f 70 79 44 |n.......|...CopyD|
|00001bb0| 65 76 69 63 65 44 72 69 | 76 65 72 00 00 00 16 77 |eviceDri|ver....w|
|00001bc0| 00 00 16 8f 19 47 65 74 | 44 72 69 76 65 72 46 72 |.....Get|DriverFr|
|00001bd0| 6f 6d 53 6c 6f 74 4d 61 | 6e 61 67 65 72 00 00 00 |omSlotMa|nager...|
|00001be0| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 00 00 00 00 00 |.H..Mona|co......|
|00001bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c00| 00 00 00 00 00 03 00 04 | 00 69 00 13 01 8c 02 7c |........|.i.....||
|00001c10| 00 69 00 13 01 8c 02 7c | ab 02 16 75 00 00 0a 34 |.i.....||...u...4|
|00001c20| 00 00 0a 34 00 00 12 08 | 00 00 00 00 01 00 00 00 |...4....|........|
|00001c30| 01 aa 00 00 00 aa 00 00 | 00 52 00 d3 6c c0 1d 04 |........|.R..l...|
|00001c40| 00 00 00 1c 00 52 00 01 | 42 4b 50 54 00 00 00 12 |.....R..|BKPT....|
|00001c50| 4d 50 53 52 00 01 00 1e | 7c 61 ff ff 00 00 00 00 |MPSR....||a......|
|00001c60| 00 00 00 00 03 ef ff ff | 00 00 00 0e 00 00 00 00 |........|........|
|00001c70| 03 ed ff ff 00 00 00 5e | 00 00 00 00 00 00 00 00 |.......^|........|
+--------+-------------------------+-------------------------+--------+--------+